using System;
using System.Collections.Generic;
using Microsoft.WindowsAzure.StorageClient;

namespace AzureContrib.WindowsAzure.StorageClient
{
	/// <summary>
	/// Contract for <see cref="CloudBlobClient"/>
	/// </summary>
	public interface ICloudBlobClient
	{
		/// <summary>
		/// <see cref="CloudBlobClient.Credentials"/>
		/// </summary>
		IStorageCredentials Credentials { get; }

		/// <summary>
		/// <see cref="CloudBlobClient.BaseUri"/>
		/// </summary>
		Uri BaseUri { get; }

		/// <summary>
		/// <see cref="CloudBlobClient"/>
		/// </summary>
		RetryPolicy RetryPolicy { get; set; }

		/// <summary>
		/// <see cref="CloudBlobClient.Timeout"/>
		/// </summary>
		TimeSpan Timeout { get; set; }

		/// <summary>
		/// <see cref="CloudBlobClient.DefaultDelimiter"/>
		/// </summary>
		string DefaultDelimiter { get; set; }

		/// <summary>
		/// <see cref="CloudBlobClient.SingleBlobUploadThresholdInBytes"/>
		/// </summary>
		long SingleBlobUploadThresholdInBytes { get; set; }

		/// <summary>
		/// <see cref="CloudBlobClient.WriteBlockSizeInBytes"/>
		/// </summary>
		long WriteBlockSizeInBytes { get; set; }

		/// <summary>
		/// <see cref="CloudBlobClient.ReadAheadInBytes"/>
		/// </summary>
		long ReadAheadInBytes { get; set; }

		/// <summary>
		/// <see cref="CloudBlobClient.UseIntegrityControlForStreamReading"/>
		/// </summary>
		bool UseIntegrityControlForStreamReading { get; set; }

		/// <summary>
		/// <see cref="CloudBlobClient.ParallelOperationThreadCount"/>
		/// </summary>
		int ParallelOperationThreadCount { get; set; }

		/// <summary>
		/// <see cref="CloudBlobClient.GetPageBlobReference(string)"/>
		/// </summary>
		CloudPageBlob GetPageBlobReference(string blobAddress);

		/// <summary>
		/// <see cref="CloudBlobClient.GetPageBlobReference(string,DateTime?)"/>
		/// </summary>
		CloudPageBlob GetPageBlobReference(string blobAddress, DateTime? snapshotTime);

		/// <summary>
		/// <see cref="CloudBlobClient.GetBlobReference(string)"/>
		/// </summary>
		CloudBlockBlob GetBlockBlobReference(string blobAddress);

		/// <summary>
		/// <see cref="CloudBlobClient.GetBlobReference(string,DateTime?)"/>
		/// </summary>
		CloudBlockBlob GetBlockBlobReference(string blobAddress, DateTime? snapshotTime);

		/// <summary>
		/// <see cref="CloudBlobClient.GetBlobReference(string)"/>
		/// </summary>
		CloudBlob GetBlobReference(string blobAddress);

		/// <summary>
		/// <see cref="CloudBlobClient.GetBlobReference(string,DateTime?)"/>
		/// </summary>
		CloudBlob GetBlobReference(string blobAddress, DateTime? snapshotTime);

		/// <summary>
		/// <see cref="CloudBlobClient.GetContainerReference"/>
		/// </summary>
		CloudBlobContainer GetContainerReference(string containerAddress);

		/// <summary>
		/// <see cref="CloudBlobClient.GetBlobDirectoryReference"/>
		/// </summary>
		CloudBlobDirectory GetBlobDirectoryReference(string blobDirectoryAddress);

		/// <summary>
		/// <see cref="CloudBlobClient.ListContainers()"/>
		/// </summary>
		IEnumerable<CloudBlobContainer> ListContainers();

		/// <summary>
		/// <see cref="CloudBlobClient.ListContainers(string)"/>
		/// </summary>
		IEnumerable<CloudBlobContainer> ListContainers(string prefix);

		/// <summary>
		/// <see cref="CloudBlobClient.ListContainers(string,ContainerListingDetails)"/>
		/// </summary>
		IEnumerable<CloudBlobContainer> ListContainers(string prefix, ContainerListingDetails detailsIncluded);

		/// <summary>
		/// <see cref="CloudBlobClient.ListContainersSegmented()"/>
		/// </summary>
		ResultSegment<CloudBlobContainer> ListContainersSegmented();

		/// <summary>
		/// <see cref="CloudBlobClient.ListContainersSegmented(string)"/>
		/// </summary>
		ResultSegment<CloudBlobContainer> ListContainersSegmented(string prefix);

		/// <summary>
		/// <see cref="CloudBlobClient.ListContainersSegmented(string,ContainerListingDetails,int,ResultContinuation)"/>
		/// </summary>
		ResultSegment<CloudBlobContainer> ListContainersSegmented(string prefix, ContainerListingDetails detailsIncluded, int maxResults, ResultContinuation continuationToken);

		/// <summary>
		/// <see cref="CloudBlobClient.BeginListContainersSegmented(AsyncCallback,object)"/>
		/// </summary>
		IAsyncResult BeginListContainersSegmented(AsyncCallback callback, object state);

		/// <summary>
		/// <see cref="CloudBlobClient.BeginListContainersSegmented(string,AsyncCallback,object)"/>
		/// </summary>
		IAsyncResult BeginListContainersSegmented(string prefix, AsyncCallback callback, object state);

		/// <summary>
		/// <see cref="CloudBlobClient.BeginListContainersSegmented(string,ContainerListingDetails,AsyncCallback,object)"/>
		/// </summary>
		IAsyncResult BeginListContainersSegmented(string prefix, ContainerListingDetails detailsIncluded, AsyncCallback callback, object state);

		/// <summary>
		/// <see cref="CloudBlobClient.BeginListContainersSegmented(string,ContainerListingDetails,int,ResultContinuation,AsyncCallback,object)"/>
		/// </summary>
		IAsyncResult BeginListContainersSegmented(string prefix, ContainerListingDetails detailsIncluded, int maxResults, ResultContinuation continuationToken, AsyncCallback callback, object state);

		/// <summary>
		/// <see cref="CloudBlobClient.EndListContainersSegmented"/>
		/// </summary>
		ResultSegment<CloudBlobContainer> EndListContainersSegmented(IAsyncResult asyncResult);

		/// <summary>
		/// <see cref="CloudBlobClient.ListBlobsWithPrefix(string)"/>
		/// </summary>
		IEnumerable<IListBlobItem> ListBlobsWithPrefix(string prefix);

		/// <summary>
		/// <see cref="CloudBlobClient.ListBlobsWithPrefix(string,BlobRequestOptions)"/>
		/// </summary>
		IEnumerable<IListBlobItem> ListBlobsWithPrefix(string prefix, BlobRequestOptions options);

		/// <summary>
		/// <see cref="CloudBlobClient.ListBlobsWithPrefixSegmented(string)"/>
		/// </summary>
		ResultSegment<IListBlobItem> ListBlobsWithPrefixSegmented(string prefix);

		/// <summary>
		/// <see cref="CloudBlobClient.ListBlobsWithPrefixSegmented(string,BlobRequestOptions)"/>
		/// </summary>
		ResultSegment<IListBlobItem> ListBlobsWithPrefixSegmented(string prefix, BlobRequestOptions options);

		/// <summary>
		/// <see cref="CloudBlobClient.ListBlobsWithPrefixSegmented(string,int,ResultContinuation)"/>
		/// </summary>
		ResultSegment<IListBlobItem> ListBlobsWithPrefixSegmented(string prefix, int maxResults, ResultContinuation continuationToken);

		/// <summary>
		/// <see cref="CloudBlobClient.ListBlobsWithPrefixSegmented(string,int,ResultContinuation,BlobRequestOptions)"/>
		/// </summary>
		ResultSegment<IListBlobItem> ListBlobsWithPrefixSegmented(string prefix, int maxResults, ResultContinuation continuationToken, BlobRequestOptions options);

		/// <summary>
		/// <see cref="CloudBlobClient.BeginListBlobsWithPrefixSegmented(string,AsyncCallback,object)"/>
		/// </summary>
		IAsyncResult BeginListBlobsWithPrefixSegmented(string prefix, AsyncCallback callback, object state);

		/// <summary>
		/// <see cref="CloudBlobClient.BeginListBlobsWithPrefixSegmented(string,int,ResultContinuation,AsyncCallback,object)"/>
		/// </summary>
		IAsyncResult BeginListBlobsWithPrefixSegmented(string prefix, int maxResults, ResultContinuation continuationToken, AsyncCallback callback, object state);

		/// <summary>
		/// <see cref="CloudBlobClient.EndListBlobsWithPrefixSegmented"/>
		/// </summary>
		ResultSegment<IListBlobItem> EndListBlobsWithPrefixSegmented(IAsyncResult asyncResult);

		/// <summary>
		/// <see cref="CloudBlobClient.ResponseReceived"/>
		/// </summary>
		event EventHandler<ResponseReceivedEventArgs> ResponseReceived;
	}
}